﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Epona.Domain.Query.Impl
{
    public class BasicCriterion:AbstractCriterion
    {
        public string PropName { get; private set; }

        public BasicCriterion(string propName)
        {
            this.PropName = propName;
        }

        protected string GetPropNameWithAlias()
        {
            return ROOT_ALIAS + "." + PropName;
        }

        protected  string GetParamName()
        {
            string result = ROOT_ALIAS + "_" + PropName;
            result = result.Replace(".", "_").Replace("-", "_");
            return result;
        }

        protected string GetParamNameWithColon()
        {
            return ":" + GetParamName();
        }
    }
}
